<?php
    include('./conn.php');

    $username=$_REQUEST['username'];
    $password=$_REQUEST['password'];

    $sql="select * from users where username='$username' and password='$password'";

    $result=$mysqli->query($sql);
    
    $name=['hasuser'=>true,'msg'=>$username];

    $json=json_encode($name);

    if($result->num_rows>0){
        echo $json;
    }else{
        echo '{"hasuser":false}';
    }
    $mysqli->close();
?>